<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title>商品查询</title>
		<link rel="stylesheet" href="__AGENT__/css/iconfont.css" />
		<link rel="stylesheet" href="__AGENT__/css/css.css" />
		<link rel="stylesheet" href="__PUBLIC__/static/layui/css/layui.css"  media="all">
	</head>

	<body>
		{include file="public/header" /}
		<div class="index_conbox">
			<div class="index_content clearfix">
				{include file="public/lefter" /}
				<div class="right">
					<div class="rigtop">
						<span class="title">商品查询</span>
					</div>
					<div class="indrig_con orders_con">
						<form id="my_form" action="{:url('count/goods_list')}" method="post">
						<div class="spfl_topbox clearfix">
							<div class="shxx_row clearfix">
					            <div class="left">商品编号：</div>
					            <div class="right clearfix">
									<input type="text" name="goods_no" placeholder="输入商品编号" class="chax_input" />
					            </div>
					            <div class="left" style="margin-left: 10px;">商品名称：</div>
					            <div class="right clearfix">
					                <input type="text" name="goods_name" placeholder="输入商品名称" class="chax_input" />
					            </div>
					        </div>
			        		<div class="shxx_row clearfix">
					            <div class="left">门店：</div>
					            <div class="right clearfix">
									<div  id="htselect">
										<select name="store_name" id="store_name">
											{volist name="agent_store" id="vo"}
												<option value="{$vo.id}">{$vo.store_name}</option>
											{/volist}
										</select>
									</div>
					            </div>
				          		<div class="left" style="margin-left: 10px;">商品分类：</div>
					            <div class="right clearfix">
									<div id="htselect">										
										<select name="type_id" id="type_id">
											<option value="">全部</option>
											{volist name="goods_type" id="vo"}
												<option value="{$vo.id}">{$vo.type_name}</option>
											{/volist}
										</select>
									</div>
					            </div>
				            	<div class="shxx_row clearfix">
					            	<button type="submit" onclick="return check_time()" class="htcxbtn">搜索</button>
					       	 	</div>
					        </div>
						</div>
						</form>
						<div class="orders_content">
							<table class="zizh_table1">
								<thead>
									<tr>
										<th>商品编号</th>
										<th>商品名称</th>
										<th>商品分类</th>
										<th>成本价</th>
										<th>销售价</th>
										<th>会员价</th>
										<th>赠送鼓励金</th>
										<th>抵扣鼓励金</th>
										<th>门店</th>
										<th>销量</th>
										<th>库存</th>
										<th>销售额</th>
										<th>赠送/抵扣</th>
									</tr>
								</thead>
								<tbody id="tbody">
									{volist name="goods_list" id="vo" empty="$empty"}
									<tr>
										<td>{$vo.goods_no}</td>
										<td>{$vo.goods_name}</td>
										<td>{$vo.type_name}</td>
										<td>{$vo.cost_price}</td>
										<td>{$vo.sale_price}</td>
										<td>{$vo.sale_price-$vo.dk_price}</td>
										<td>{$vo.zs_price}</td>
										<td>{$vo.dk_price}</td>
										<td>{$vo.store_name}</td>
										<td>
											{$vo.sales}
										</td>
										<td>
											{$vo.stock}
										</td>
										<td>{$vo.total_money}</td>
										<td>{$vo.zs_price}/{$vo.dk_price}</td>
									</tr>
									{/volist}
								</tbody>
							</table>
							<div class="fenye" style="display: block;">
								{if $goods_list}
								{$goods_list->render()}
								{/if}
								
							</div>

						</div>
					</div>
				</div>
			</div>
		</div>
		{include file="public/footer" /}
	</body>

</html>
<script type="text/javascript" src="__PUBLIC__/static/js/assist.js"></script>
<script type="text/javascript">
	
	//调取修改商品页面
	function goods_edit(goods_id) {
		layer.open({
		  type: 2,
		  title: '发布商品',
		  shadeClose: true,
		  shade: 0.8,
		  area: ['900px', '740px'],
		  content: "{:url('shop/goods_edit',['goods_id'=>"+goods_id+"])}"
		}); 
	}

	layui.use('laydate', function(){
		var laydate = layui.laydate;
		
		//日期控件
		laydate.render({
		    elem: '#begin_time'
		    ,type: 'datetime'
		    ,format: 'yyyy-MM-dd HH:mm:ss'
		});
		  
		laydate.render({
		    elem: '#end_time'
		    ,type: 'datetime'
		    ,format: 'yyyy-MM-dd HH:mm:ss'
		});
	})

	//商品分类
	$('#to_goods_tpe').click(function(){
		location.href = "goods_type.html";
	})
	
	//时间区间
	function check_time(){
		var begin_time 	= $('#begin_time').val();
		var end_time 	= $('#end_time').val();	
		if(begin_time.length > 2 || end_time.length > 2){
			
			if(begin_time.length < 2 || end_time.length < 2){
				layer.msg("请输入查询时间区间");
				return false;
			}
			
		}
	}
	

</script>
